<template>
  <div>
    <header>
      <van-row type="flex" justify="space-between">
        <van-col span="8">
          <router-link to="/layout/Mine">
            <van-icon name="arrow-left" />
          </router-link>
        </van-col>
        <van-col span="8">我的收藏主页</van-col>
        <van-col span="8"></van-col>
      </van-row>
    </header>
    <div style="height: 50px"></div>
    <div v-for="(item, index) in list" :key="index" class="title">
      <router-link
        :to="{ path: '/detail', query: { articleId: item.articleId } }"
        style="color: #409eff"
      >
        <van-icon name="star" /> {{ item.title }}
      </router-link>
    </div>
    <div style="height: 50px"></div>
  </div>
</template>
<script>
import { collectNewList } from "../api/api";
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    collectNewList().then((res) => {
      // console.log(res);
      this.list = res.rows;
    });
  },
};
</script>
<style lang="less" scoped>
* {
  margin: 0;
  padding: 0;
}
header {
  width: 100%;
  height: 50px;
  line-height: 50px;
  background-color: #eee;
  position: fixed;
  top: 0;
}
.title {
  padding: 10px;
  margin-top: 10px;
  //   color: #409eff;
}
</style>